package cn.youfule.dp.command;

import java.util.ArrayList;
import java.util.List;

public class Boy {
	
	private String name;
	
	private List<Command> commands = new ArrayList<Command>();
	private List<Command> executedCommands = new ArrayList<Command>();
	
	
	public void pursue(MM mm) {
		
	}
	public void doSomeThing() {
		
	}
	
	public void addCommand(Command c) {
		this.commands.add(c);
	}
	
	public void executeCommands() {
		for(Command c : commands) {
			c.execute();
			executedCommands.add(c);
		}
	}
	
	public void undoCommands() {
		for(Command c: executedCommands) {
			c.unDo();
		}
	}
	

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
}
